package demo.tellurium.test;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import demo.tellurium.framework.BaseTelluriumJUnitTestCase;
import demo.tellurium.module.TreeGridModule;

public class TreeGridModuleJUnitTestCase extends BaseTelluriumJUnitTestCase {
    private static TreeGridModule treegrid;

    @BeforeClass
    public static void initUi() {
        treegrid = new TreeGridModule();
        treegrid.defineUi();
    }

    @Before
    public void connectTo() {
        connectUrl(treegrid.url);
    }

    @Ignore
    @Test
    public void testDebug() {
        console.debug("[testDebug]");
        treegrid.getHTMLSource("treegrid.content.row.checkbox");
        // console.debug(treegrid.getLocatorCount("*.dojoxGridRowToggle-1"));
        console.debug("[getSelector]", treegrid.getSelector("treegrid.content.row.checkbox"));
        console.debug("[getLocator]", treegrid.getLocator("treegrid.content.row.checkbox"));
        // treegrid.getCssSelectorCount(cssSelector);
        pauseSec(5);
    }

    @Ignore
    @Test
    public void testClickCheckBox() {
        console.debug("[testClickCheckBox]");
        String uid = "treegrid.content.row.checkbox";
        console.debug("[getLocator]", treegrid.getLocator(uid));
        pauseSec(3);
        treegrid.click(uid);
        pauseSec(3);
        treegrid.click(uid);
        pauseSec(5);
    }

    @Test
    public void testExpandCell() {
        console.debug("[testExpandCell]");
        String uid = "treegrid.content.row.ExpandoCell.Expando.ExpandoNode";
        console.debug("[getLocator]", treegrid.getLocator(uid));
        pauseSec(3);
        treegrid.doToggleCell();
    }

}
